package com.controller.setting;

import com.comm.R;
import com.entity.InspectionItem;
import com.service.setting.SysPrescriptionService;
import com.service.setting.SystemInspectionService;
import com.service.setting.SystemProjecttableService;
import io.swagger.annotations.*;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.*;

import java.math.BigDecimal;
@RequestMapping(value = "/setting/SystemInspection")
@Controller
@Api(value = "项目检查费",tags = "项目检查费接口")
@ApiResponses({
        @ApiResponse(code=200,message="请求成功"),
        @ApiResponse(code=404,message="找不到页面"),
        @ApiResponse(code=403,message="请求禁止"),
        @ApiResponse(code=401,message="请求未授权"),
        @ApiResponse(code=500,message="后台服务错误")})
//这个类项目检查费
public class SystemInspection {

    @Autowired
    private SystemProjecttableService systemProjecttableService;

    @Autowired
    private SystemInspectionService service;
// 1.3.1：条件查找项目检查费
@ResponseBody
@RequestMapping(value ="/fundInspection",method = RequestMethod.GET)
@ApiOperation(value = "条件查找项目检查费 的接口",notes = "条件查找项目检查费",httpMethod = "post", response = String.class)
@ApiImplicitParam(name = "itemname",value = "项目名称",required = true,dataType = "String",paramType = "query")
public  R fundInspection(@RequestParam(name = "itemName")String  itemName){
    return service.fundInspection(itemName);
}
    //1.3.2：查找项目检查费
    @ResponseBody
    @RequestMapping(value ="/fundInspections",method = RequestMethod.GET)
    @ApiOperation(value = "查找项目检查费接口",notes = "查找项目检查费",httpMethod = "post", response = String.class)
    public  R fundInspections(Integer currentPage,Integer pageSize){
       return service.fundInspections(currentPage,pageSize);
    }
    //   1.3.3：添加项目检查费的接口：
    @ResponseBody
    @RequestMapping(value ="/addInspection",method = RequestMethod.POST)
    @ApiOperation(value = "添加处方附加费的接口",notes = "添加处方附加费",httpMethod = "post", response = String.class)
    public  R addInspection(@RequestBody @ApiParam(name = "实体类",value = "inspectionItem") InspectionItem inspectionItem){
        return service.addInspection(inspectionItem);

    }
    // 1.3.4：编辑项目检查费的接口：
    @ResponseBody
    @RequestMapping(value ="/editInspection",method = RequestMethod.POST)
    @ApiOperation(value = "编辑项目检查费的接口",notes = "编辑项目检查费的",httpMethod = "post", response = String.class)
    public  R editInspection(@RequestBody @ApiParam(name = "实体类",value = "inspectionItem") InspectionItem inspectionItem){

        return service.editInspection(inspectionItem);
    }
    // 1.3.5：删除项目检查费的接口：
    @ResponseBody
    @RequestMapping(value ="/deltInspection",method = RequestMethod.POST)
    @ApiOperation(value = "删除项目检查费的接口",notes = "项目检查费",httpMethod = "post", response = String.class)
    @ApiImplicitParam(name = "id",value = "主键id",required = true,dataType = "int",paramType = "query")
    public  R delInspection(@RequestParam(name = "id")Integer id){
        return service.delInspection(id);
    }
//    1.3.6：添加项目检查费跟编辑项目检查费部分参数接口（对应动态获取参数，对应项目字典表）：
@ResponseBody
@RequestMapping(value ="/fundprojectss",method = RequestMethod.GET)
@ApiOperation(value = "查找项目字典表接口",notes = "查找项目字典表",httpMethod = "post", response = String.class)
public  R fundprojects(){
    return systemProjecttableService.fundProjectTable() ;
}

}

